export const state = {
	//用户数据
	userInfo: {},
	// 关联公司
	// userCompany: []
	proJectId: '',
};
// 解决刷新消失问题
var stateData = null
stateData = uni.getStorageSync('userInfo')
state.userInfo = stateData || {}

export const mutations = {
	//储存用户信息
	setUserInfo(state, data) {
		if (data) {
			state.userInfo = Object.assign({}, state.userInfo, data);
			uni.setStorageSync('userInfo', state.userInfo);
		}

	},
	// 退出APP
	emptyUserInfo(state) {
		state.userInfo = {};
		uni.removeStorageSync("userInfo");
		uni.removeStorageSync("token");
		uni.removeStorageSync("accessToken");
		uni.removeStorageSync("refreshToken");
	},
};
export const actions = {

};
